package dblayer;

import static org.junit.Assert.fail;
import modellayer.KeyPerson;
import org.junit.Test;

public class KeyPersonDBTest
{
	KeyPersonDB kpDB = new KeyPersonDB();
	KeyPerson keyPerson;
	
	@Test
	public void findKeyPersonInDatabase()
	{
		int keyPersonId;
		String info;
		int info2;
		
		try
		{
			keyPersonId = 2;
			keyPerson = kpDB.findKeyPersonById(keyPersonId);
			info = "KeyPerson name: " +keyPerson.getName();
			info2 = keyPerson.getCompanyList().size();
			System.out.println(info);
			System.out.println("Company associasions: " +info2);
			System.out.println("Size of listAllKeyPersons: " +kpDB.listAllKeyPersons().size());
		}
		catch (Exception e)
		{
			fail("Failed to find KeyPerson. Exception: " +e);
		}
	}
	
	
}
